/*
 * @Author: your name
 * @Date: 2021-05-11 17:49:31
 * @LastEditTime: 2021-05-12 10:30:11
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \koa2-serve\model\user.js
 */
const mongoose = require('../dbHelper.js')
const {defaultSchemaExtend,defaultSchemaOptions}=require('../config.js')

const Schema = mongoose.Schema;
const UserSchema = new Schema(Object.assign({
    userName: String,
    age: {
        type: Number,
        min: 18,
        max: 99
    },
    phone: String,
    tags: {
        type: Array
    }
}, defaultSchemaExtend), defaultSchemaOptions);

module.exports = mongoose.model('User', UserSchema, 'Users');